Enhancing Worst Sorting Algorithms

نویسنده

  • Md. Khairullah
چکیده

Sorting is a commonly used operation in computer science. In addition to its main job, sorting is often required to facilitate some other operation such as searching, merging and normalization. There are many sorting algorithm that are being used in practical life as well as in computation. A sorting algorithm consists of comparison, swap, and assignment operations. Bubble sort, selection sort and insertion sort are algorithms which are easy to comprehend but have the worst time complexity of O(n). In this paper enhancement of the selection sort and the bubble sort by eliminating some useless comparisons is presented. A stack is used to store the locations of the past or local maximums, which can be used in later iterations of these algorithms. The insertion sort is improved by reducing shift operations with the aid of a double sized temporary array. The new algorithms are discussed, analyzed, tested and executed for benchmarking along with representing results. A significant improvement of well above 200% is achieved.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Which sorting algorithms to choose for hard real-time applications

This paper compares the worst case performance of eight standard sorting algorithms It investigates how well suited these algorithms are for hard real time sys

متن کامل

Variation in Best-Case and Worst-Case Performance for Sorting Algorithms

This research examines variation in performance for sorting algorithms in "best-case" and "worst case" situations. Our primary focus is on central tendency and dispersion of execution times for six sorting algorithms. Arrays containing fixed integer sequences are initialized in either increasing (already sorted, representing best-case) or decreasing (reverse sorted, representing worst-case) ord...

متن کامل

The Worst Case in Shellsort and Related Algorithms

We show that sorting a sufficiently long list of length N using Shellsort with m increments (not necessarily decreasing) requires at least N √ m comparisons in the worst case, for some constant c > 0. For m ≤ (log N/ log log N) we obtain an upper bound of the same form. We also prove that Ω(N(log N/ log log N)) comparisons are needed regardless of the number of increments. Our approach is gener...

متن کامل

Introspective Sorting and Selection Algorithms

Quicksort is the preferred in-place sorting algorithm in many contexts, since its average computing time on uniformly distributed inputs is (N log N) and it is in fact faster than most other sorting algorithms on most inputs. Its drawback is that its worst-case time bound is (N 2). Previous attempts to protect against the worst case by improving the way quicksort chooses pivot elements for part...

متن کامل

A Machine Learning Approach to Predicting the Smoothed Complexity of Sorting Algorithms

Smoothed analysis is a framework for analyzing the complexity of an algorithm, acting as a bridge between average and worst-case behaviour. For example, Quicksort and the Simplex algorithm are widely used in practical applications, despite their heavy worst-case complexity. Smoothed complexity aims to better characterize such algorithms. Existing theoretical bounds for the smoothed complexity o...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2013